
 <!--*****************  LEFT  *****************-->
      <div class="columnLeft">
          <div class="content">
              <!--*****************  MENU  *****************-->
              <div class="contentMenu">

                  <div class="contentMenuItems">
                      <ul>
                          <li class="contentMenuTitle"><?php __('Actions'); ?></li>
                          <li class="contentMenuSeparator"></li>
                          		<li><?php echo $this->Html->link(__('New User', true), array('action' => 'add')); ?></li>
		
		<li><?php echo $this->Html->link(__('List Statuses', true), array('controller' => 'statuses', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Status', true), array('controller' => 'statuses', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Jobfunctions', true), array('controller' => 'jobfunctions', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Jobfunction', true), array('controller' => 'jobfunctions', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Securitygroups', true), array('controller' => 'securitygroups', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Securitygroup', true), array('controller' => 'securitygroups', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Companies', true), array('controller' => 'companies', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Company', true), array('controller' => 'companies', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Groups', true), array('controller' => 'groups', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Group', true), array('controller' => 'groups', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Dmdforms', true), array('controller' => 'dmdforms', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Dmdform', true), array('controller' => 'dmdforms', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Formstatuses', true), array('controller' => 'formstatuses', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Formstatus', true), array('controller' => 'formstatuses', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Jobprofiles', true), array('controller' => 'jobprofiles', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Jobprofile', true), array('controller' => 'jobprofiles', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Powerdelegations', true), array('controller' => 'powerdelegations', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Powerdelegation', true), array('controller' => 'powerdelegations', 'action' => 'add')); ?> </li>
                          <li class="contentMenuSeparator"></li>
                          <li class="contentMenuBottom"></li>
                      </ul>
                  </div>

              </div>
          </div>
      </div>
<!--*****************  RIGHT  *****************-->
      <div class="columnRight">
          <div class="content">
              <div class="contentCenter">
                  <h2 class="pointer showNextDiv"><?php echo __('Filter users'); ?></h2>
                  <div class="isHidden">
              <?php
            echo $this->Form->create(null,array('url'=>'filterUsersIndex'));
            ?> <table><tbody><tr><td> <?php
                echo $this->Form->input('name',array('label'=>__('Name',true)));?> </td><td> <?php
                echo $this->Form->input('surname',array('label'=>__('Surname',true)));?> </td></tr><tr><td> <?php
                echo $this->Form->input('id_code',array('label'=>__('Id Code',true)));?> </td><td> <?php
                echo $this->Form->input('id_erp',array('label'=>__('ERP login',true)));?> </td></tr><tr><td> <?php
                echo $this->Form->input('id_win',array('label'=>__('Windows login',true)));?> </td><td> <?php
                echo $this->Form->input('id_hr',array('label'=>__('Human Resource identifiant',true)));?> </td></tr><tr><td> <?php
                echo $this->Form->input('mail',array('label'=>__('E-mail',true)));?> </td><td> <?php
                echo $this->Form->input('group_id',array('options'=>$groups,'empty'=>'select','label'=>__('ALWPA Group name',true)));?> </td></tr></tbody></table><?php

            echo $this->Form->end('submit');
            ?>
                      </div>
              </div>  
              
              <div class="contentCenter">

<div class="users index">
	<h2><?php __('Users');?></h2>
	<table class="formstatus">
            <thead>
	<tr>
			<th><?php echo $this->Paginator->sort('id');?></th>
			<th><?php echo $this->Paginator->sort('name');?></th>
			<th><?php echo $this->Paginator->sort('surname');?></th>
                        <th class="actions"><?php __('Actions');?></th>
			<th><?php echo $this->Paginator->sort('id_code');?></th>
			<th><?php echo $this->Paginator->sort('id_erp');?></th>
			<th><?php echo $this->Paginator->sort('id_win');?></th>
			<th><?php echo $this->Paginator->sort('id_hr');?></th>
			<th><?php echo $this->Paginator->sort('backup_id');?></th>
			<th><?php echo $this->Paginator->sort('manager_id');?></th>
			<th><?php echo $this->Paginator->sort('hrreferent_id');?></th>
			<th><?php echo $this->Paginator->sort('contract_begin');?></th>
			<th><?php echo $this->Paginator->sort('contract_end');?></th>
			<th><?php echo $this->Paginator->sort('status_id');?></th>
			<th><?php echo $this->Paginator->sort('jobfunction_id');?></th>
			<th><?php echo $this->Paginator->sort('jde_user');?></th>
			<th><?php echo $this->Paginator->sort('baali_user');?></th>
			<th><?php echo $this->Paginator->sort('securitygroup_id');?></th>
			<th><?php echo $this->Paginator->sort('company_id');?></th>
			<th><?php echo $this->Paginator->sort('group_id');?></th>
			<th><?php echo $this->Paginator->sort('mail');?></th>
			<th><?php echo $this->Paginator->sort('username');?></th>
			<th><?php echo $this->Paginator->sort('password');?></th>
			<th><?php echo $this->Paginator->sort('notes');?></th>
			<th><?php echo $this->Paginator->sort('backup_of');?></th>
			<th><?php echo $this->Paginator->sort('replace');?></th>
			<th><?php echo $this->Paginator->sort('created');?></th>
			<th><?php echo $this->Paginator->sort('modified');?></th>
			<th class="actions"><?php __('Actions');?></th>
	</tr></thead><tbody>
	<?php
	$i = 0;
	foreach ($users as $user):
		$class = null;
		if ($i++ % 2 == 0) {
				$class = ' class="pair"';
			}else{
                            $class = ' class="impair"';
                        }
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $user['User']['id']; ?>&nbsp;</td>
		<td><?php echo $user['User']['name']; ?>&nbsp;</td>
		<td><?php echo $user['User']['surname']; ?>&nbsp;</td>
                <td class="actions">
			<?php echo $this->Html->link(__('View', true), array('action' => 'view', $user['User']['id']),array('class'=>'details')); ?>
			<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $user['User']['id']),array('class'=>'edit')); ?>
			<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $user['User']['id']), array('class'=>'FormDelete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
		</td>
		<td><?php echo $user['User']['id_code']; ?>&nbsp;</td>
		<td><?php echo $user['User']['id_erp']; ?>&nbsp;</td>
		<td><?php echo $user['User']['id_win']; ?>&nbsp;</td>
		<td><?php echo $user['User']['id_hr']; ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($user['Backup']['name'], array('controller' => 'backups', 'action' => 'view', $user['Backup']['id'])); ?>
		</td>
		<td>
			<?php echo $this->Html->link($user['Manager']['name'], array('controller' => 'managers', 'action' => 'view', $user['Manager']['id'])); ?>
		</td>
		<td>
			<?php echo $this->Html->link($user['Hrreferent']['name'], array('controller' => 'hrreferents', 'action' => 'view', $user['Hrreferent']['id'])); ?>
		</td>
		<td><?php echo $user['User']['contract_begin']; ?>&nbsp;</td>
		<td><?php echo $user['User']['contract_end']; ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($user['Status']['title'], array('controller' => 'statuses', 'action' => 'view', $user['Status']['id'])); ?>
		</td>
		<td>
			<?php echo $this->Html->link($user['Jobfunction']['title'], array('controller' => 'jobfunctions', 'action' => 'view', $user['Jobfunction']['id'])); ?>
		</td>
		<td><?php echo $user['User']['jde_user']; ?>&nbsp;</td>
		<td><?php echo $user['User']['baali_user']; ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($user['Securitygroup']['title'], array('controller' => 'securitygroups', 'action' => 'view', $user['Securitygroup']['id'])); ?>
		</td>
		<td>
			<?php echo $this->Html->link($user['Company']['title'], array('controller' => 'companies', 'action' => 'view', $user['Company']['id'])); ?>
		</td>
		<td>
			<?php echo $this->Html->link($user['Group']['title'], array('controller' => 'groups', 'action' => 'view', $user['Group']['id'])); ?>
		</td>
		<td><?php echo $user['User']['mail']; ?>&nbsp;</td>
		<td><?php echo $user['User']['username']; ?>&nbsp;</td>
		<td><?php echo $user['User']['password']; ?>&nbsp;</td>
		<td><?php echo $user['User']['notes']; ?>&nbsp;</td>
		<td><?php echo $user['User']['backup_of']; ?>&nbsp;</td>
		<td><?php echo $user['User']['replace']; ?>&nbsp;</td>
		<td><?php echo $user['User']['created']; ?>&nbsp;</td>
		<td><?php echo $user['User']['modified']; ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('View', true), array('action' => 'view', $user['User']['id']),array('class'=>'details')); ?>
			<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $user['User']['id']),array('class'=>'edit')); ?>
			<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $user['User']['id']), array('class'=>'FormDelete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
            </tbody></table>
        <div class="paginate">
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?>	

	<div class="paging">
		<?php echo $this->Paginator->prev( __('previous', true), array(), null, array('class'=>'prev'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true), array(), null, array('class' => 'next'));?>
	</div>
    </div>

</div>
              </div>
          </div>
      </div>
<div class="clear"></div>